<template>
  <div>
    <!-- 管理员 -->
    <div v-if="isAdmin">
      <Admin />
    </div>

    <!-- 商户 -->
    <div v-if="!isAdmin">
      <IndexBusiness />
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted } from "vue";
import { useAdminStore } from "@/stores/admin";
import Admin from "@/views/index/admin/Admin.vue";
import IndexBusiness from '@/views/index/business/IndexBusiness'
const adminStore = useAdminStore();
const isAdmin = ref(false);
onMounted(() => {
  if (adminStore.admin.role === "管理员") {
    isAdmin.value = true;
  }
});
</script>
